import { Injectable } from '@nestjs/common';

@Injectable()
export class AttachmentService {
  upload(file: Express.Multer.File) {
    let path = file.path.replaceAll('\\', '/')
    path = path.startsWith('public/') ? path.substring(7): path
    return {
      ...file,
      path,
      name: file.originalname
    }
  }
}
